import request from '@/router/axios';

export const getProductList = (current, size, params) => {
  return request({
    url: '/api/mes-admin/part-master/page?semifinished=true',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const getSteelMeshList = (current, size, params) => {
  return request({
    url: '/api/mes-product/ems-equipment/page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const getDetail = (id) => {
  return request({
    url: '/api/mes-product/ems-equipment/detail',
    method: 'get',
    params: {
      id
    }
  });
};

export const remove = (ids) => {
  return request({
    url: '/api/mes-product/ems-equipment/remove',
    method: 'post',
    params: {
      ids
    }
  });
};

export const inspection = (ids) => {
  return request({
    url: '/api/mes-product/ems-equipment/send-inspect',
    method: 'get',
    params: {
      ids
    }
  });
};

export const inspectionDetail = (id) => {
  return request({
    url: '/api/mes-product/ems-equipment-inspection/detail',
    method: 'get',
    params: {
      id
    }
  });
};

export const add = (row) => {
  return request({
    url: '/api/mes-product/ems-equipment/submit',
    method: 'post',
    data: row
  });
};

export const update = (row) => {
  return request({
    url: '/api/mes-product/ems-equipment/submit',
    method: 'post',
    data: row
  });
};

//领用记录
export const getUseRecord = (current, size, params) => {
  return request({
    url: '/api/mes-product/ems-equipment-usage/page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

//检验记录
export const getInspectionRecord = (current, size, params) => {
  return request({
    url: '/api/mes-product/ems-equipment-inspection/equipment-inspection-page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const enableOrDisable = (data) => {
  return request({
    url: '/api/mes-product/ems-equipment/update-status',
    method: 'post',
    data
  });
};
